import type {
    AxiosResponse,
    InternalAxiosRequestConfig,
    CreateAxiosDefaults,
    AxiosRequestConfig,
  } from 'axios'
  export interface RequestInterceptors<T> {
    // 请求拦截
    requestInterceptors?: (
      config: InternalAxiosRequestConfig,
    ) => InternalAxiosRequestConfig
    requestInterceptorsCatch?: (err: any) => any
    // 响应拦截
    responseInterceptors?: (config: T) => T
    responseInterceptorsCatch?: (err: any) => any
  }
  // 自定义传入的参数
  export interface CreateRequestConfig<T = AxiosResponse>
    extends CreateAxiosDefaults {
    interceptors?: RequestInterceptors<T>
  }
  export interface RequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
    interceptors?: RequestInterceptors<T>
  }
  export interface CancelRequestSource {
    [index: string]: () => void
  }